package Test;
public class Array {
    public static void main(String[] args) {
        int[] array = {20, 10, 50, 40, 30, 70, 95, 80, 90, 100};
        int target = 50;
        boolean found = false;

        // 查找目标元素的位置/
        for (int i = 0; i < array.length; i++) {
            if (array[i] == target) {
                System.out.println("元素 " + target + " 在位置 " + i + " 被找到。");
                found = true;
                break;
            }
        }

        if (!found) {
            System.out.println("数组中没有找到元素 " + target + "。");
        }
    }
}